docs(skills): config-first idiomatic usage in CLI skill examples#355
Merged
docs(skills): config-first idiomatic usage in CLI skill examples#355
Conversation
Update b2c CLI skills so command examples assume configured values (tenantId, shortCode, slasClientId, clientId, server) resolve from dw.json / SFCC_* env vars, with flags shown only as overrides. This prevents coding agents from prompting users for values that are already present in their configuration. Affected skills: scapi-schemas, scapi-custom, slas, ecdn (+ references), cip, users-roles.
When running interactively, detect already-installed skills and prompt the user to overwrite them rather than requiring the --update flag up front. Non-interactive behavior (--force, --update, --json) is preserved. Widen isSkillInstalled options to include the optional directory override so the target-path check matches the installer's resolution when --directory is provided.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tenantId,shortCode,slasClientId,clientId,server) resolve fromdw.json/SFCC_*env vars, with flags shown only as overrides.--client-id,--client-secret,--tenant-id,--short-code).b2c-configskill for the precedence model. The CLI already emits actionable errors when a required value is missing, so skills no longer need to pre-emptively demand flags.Affected skills
b2c-scapi-schemas— stripped--tenant-id zzxy_prdfrom every example; kept one override example; softened "required" language.b2c-scapi-custom— same treatment as scapi-schemas.b2c-slas— stripped--tenant-id; collapsed duplicated token examples; moved--short-code/--slas-client-*overrides into a config overrides section.b2c-ecdn(+references/SECURITY.md,references/ADVANCED.md) — stripped--tenant-idthroughout.b2c-cip— rewrote Requirements as config-first; removed--tenant-id abcd_prdfrom examples.b2c-users-roles— minimalb2c bm roles listfirst;--servershown as override.Audited, no changes needed
b2c-am— credentials framed correctly in the Authentication section (CI/CD override path).b2c-sandbox—--realmis genuinely required (no config fallback).b2c-sites,b2c-docs,b2c-code,b2c-config— already idiomatic.Changeset
Added
.changeset/skill-config-first-examples.md(patch@salesforce/b2c-cli).Test plan
dw.jsonwithout extra flags.b2c scapi schemas listb2c scapi custom statusb2c slas client listb2c ecdn zones listb2c cip tables